import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
const routes: Array<RouteRecordRaw> = [
  {
    // 销售员页面
    path: '/saler',
    name: 'saler',
    component: () => import("@/views/saler/saler"),
    meta: {
      title: '菏泽惠民保业务员',
    }
  },
  {
    // 投保页面
    path: '/insure',
    name: 'insure',
    component: () => import("@/views/insure/insure"),
    meta: {
      title: '菏泽惠民保',
    }
  },
  {
    // 订单列表
    path: '/orderList',
    name: 'orderList',
    component: () => import("@/views/orderList/orderList"),
    meta: {
      title: '订单中心',
    }
  },
  {
    // 订单详情
    path: '/orderDetail',
    name: 'orderDetail',
    component: () => import("@/views/orderDetail/orderDetail"),
    meta: {
      title: '订单详情',
    }
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

router.afterEach((to,form) => {
  (document as any).title = to.meta.title;
})

export default router;